In digital cameras, autofocus may be used to focus on an object of interest. Such digital cameras may be provided as stand alone devices or they may be integrated into a multipurpose device such as a smartphone or the like. In various implementations, digital cameras may use contrast based autofocus. For example, implementing contrast based autofocus may include measuring contrast of images (or portions thereof) attained via an image sensor and using the image having the greatest contrast as best focus (with the assumption being in focus images have higher contrast than out of focus images). Such passive contrast based autofocus systems have inherent limitations including neither the location of peak focus nor the direction and offset to peak focus being known based on a single contrast measurement.
Instead, the digital camera may scan through a range of positions before a maximum contrast measurement is found. Such techniques make autofocus convergence times relatively slow (e.g., 5-10 iterations on average) and autofocus convergence susceptible to camera and/or object motion, lighting conditions, and scene contrast. Furthermore, such autofocus techniques are susceptible to overshoots (e.g., the camera changing lens position past the position of focus to obtain the information needed to determine the position of focus as performed in contrast based autofocus). Such overshoots may be seen as lens oscillations around the optimal in-focus position and they may take time and reduce quality in video capture
In other implementations, digital cameras may use phase detection autofocus. Phase detection autofocus may improve focusing speed and reduce overshoot but such systems may require more costly and sophisticated sensors (e.g., sensors including phase autofocus pixels and associated circuitry). Such systems may therefore increase the cost of digital cameras and digital camera modules integrated into multipurpose devices. Furthermore, phase autofocus systems may be not be reliable for all scenes and in all conditions.
Therefore, current contrast based autofocus techniques may provide relatively slow focus and problems during video capture and current phase autofocus systems may be relatively expensive and sometimes unreliable. Such problems may become critical as the use of digital cameras and, particularly, small sized digital cameras, cameras integrated into smartphones, and mass produced digital cameras becomes more widespread